<script setup lang="ts">
import { ref } from "vue";
import { invoke } from "@tauri-apps/api/tauri";
// import { getName } from '@tauri-apps/api/app';

const greetMsg = ref("");
const name = ref("");
const test = ref("");
import { appWindow, LogicalSize } from '@tauri-apps/api/window';


async function greet() {
  // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
  //await message('Tauri is awesome', 'Tauri');
  greetMsg.value = await invoke("greet", { name: name.value });
  await appWindow.setSize(new LogicalSize(600, 100));

}
</script>

<template>
  <form class="row" @submit.prevent="greet">
    <input id="greet-input" v-model="name" placeholder="Enter a name..." />
    <button type="submit">Greet</button>

    <p>{{ greetMsg }}</p>
    <p>{{ test }}</p>
  </form>
</template>
